<?php

require_once __DIR__ . '/vendor/autoload.php';

$app = require_once __DIR__ . '/bootstrap/app.php';
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();

use App\Models\User;
use Illuminate\Support\Facades\Hash;

// 重置admin用户密码
try {
    $user = User::where('username', 'admin')->first();

    if ($user) {
        $user->password = Hash::make('admin123');
        $user->save();

        echo "✅ 密码重置成功！\n";
        echo "用户名: admin\n";
        echo "新密码: admin123\n";
        echo "密码哈希: " . $user->password . "\n";
    } else {
        echo "❌ 未找到admin用户\n";
    }
} catch (Exception $e) {
    echo "❌ 密码重置失败: " . $e->getMessage() . "\n";
}
